package com.spark.core.action

import org.apache.spark.{SparkConf, SparkContext}

/**
 * count 统计RDD共有多少行数据
 */
object Demo1_count {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
    conf.setAppName("count")
    conf.setMaster("local")
    val sc = new SparkContext(conf)
    sc.setLogLevel("error")

    val lines = sc.textFile("./data/sampleData.txt")
    val count: Long = lines.count()
    println(count)

  }
}
